package com.jsgt.greekfire.ui.mainassets.coindetail

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import com.fhx.core.base.BaseFragment
import com.jsgt.greekfire.R
import com.jsgt.greekfire.bean.MyTeamBean
import com.jsgt.greekfire.common.util.RecycleEmptyView
import com.jsgt.greekfire.ui.mainassets.coindetail.adapter.CoinAPPApplicationtAdapter
import com.scwang.smartrefresh.header.MaterialHeader
import kotlinx.android.synthetic.main.fragment_coin_app_application.*
import java.util.*

private const val ARG_PARAM = "param"

class CoinAPPApplicationFragment : BaseFragment() {
    private val coinAPPApplicationtAdapter by lazy {
        CoinAPPApplicationtAdapter(context!!, R.layout.item_coin_app_applicationt_list)
    }
    private val list: ArrayList<MyTeamBean> = ArrayList<MyTeamBean>()

    companion object {
        @JvmStatic
        fun newInstance(param: String) =
            CoinAPPApplicationFragment().apply {
                arguments = Bundle().apply {
                    putString(ARG_PARAM, param)
                }
            }
    }

    override fun getLayoutId(): Int = R.layout.fragment_coin_app_application
    override fun main() {
        //设置 Header 为 MaterialHeader
        refresh.setRefreshHeader(MaterialHeader(context))
        recycler.setLayoutManager(LinearLayoutManager(context))
        recycler.adapter = coinAPPApplicationtAdapter
        RecycleEmptyView.showEmptyView(
            activity as AppCompatActivity?,
            coinAPPApplicationtAdapter,
            "暂无应用",
            R.mipmap.icon_empty_no_data
        )
        /* for (i in 1..5) {
             var myTeamBean = MyTeamBean()
             // list.add(new MyTeamBean(R.mipmap.test_head,3,"安全等级：中级","APP"));
             myTeamBean.image = R.mipmap.ic_launcher
             myTeamBean.rating = i
             myTeamBean.name = "123" + i
             myTeamBean.securityLevel = "安全等级：中级"
             list.add(myTeamBean)
         }
         coinAPPApplicationtAdapter?.replaceData(list!!)*/
    }
}